<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Login</title>
		<link rel="stylesheet" href="/edu/themes/base/jquery.ui.all.css" />
		<link rel="stylesheet" href="/edu/styles.css"/>
		<script src="/edu/jquery-1.7.1.js"></script>
		<script type="text/javascript">

			function addInstitute() {
				var institute = {
					name :  $('#name').val(),
					addressLine1 :  $('#addressLine1').val(),
					addressLine2 :  $('#addressLine2').val(),
					city :  $('#city').val(),
					state :  $('#state').val(),
					country :  $('#country').val(),
				};
			$.ajax({
				type: "POST",  
				url: "/edu/e/coursemgt/institute",  
				data: JSON.stringify(institute),
				contentType:"application/json; charset=utf-8",
				success: function(response){  
					// we have the response  
					$('#info').html(response);
				},  
				error: function(e){  
				  alert('Error: ' + e);  
				}  
				})
				
			}
		</script>
	</head>
	
	<body>
		<h1>Add Institute</h1>
		<table>
			<tr><td>Institute Name: </td><td> <input type="text" id="name"><br/></td></tr>
			<tr><td>Address Line 1 : </td><td><input type="text" id="addressLine1"><br/></td></tr>
			<tr><td>Address Line 2 : </td><td><input type="text" id="addressLine2"><br/></td></tr>
			<tr><td>City : </td><td><input type="text" id="city"><br/></td></tr>
			<tr><td>State : </td><td><input type="text" id="state"><br/></td></tr>
			<tr><td>Country : </td><td><input type="text" id="country"><br/></td></tr>
			<tr><td colspan="2"><input type="button" value="" onclick="addInstitute()"><br/></td></tr>
			<tr><td colspan="2"><div id="info" style="color: green;"></div></td></tr>
		</table>
	</body>
	
</html>